import { server } from "@/request";

import type { IRes, IResPageType, recordType, IResTradeType } from "./api";

export const reqTradeMarkList = (page = 1, limit = 5) => {
  return server.get<any, IResTradeType>(
    `/product/baseTrademark/${page}/${limit}`
  );
};
//品牌列表type
export interface trademarkListType {
  id: number;
  tmName: string;
  logoUrl: string;
}
//添加
export const reqTradeSave = (data: Omit<recordType, "id">) => {
  return server.post<any, null>("product/baseTrademark/save", data);
};
//修改
export const reqUpdateTrademark = (data: recordType) => {
  return server.put<any, null>("/product/baseTrademark/update", data);
};
//删除
export const reqDelTradeItem = (id: number) => {
  return server.delete<any, null>(`/product/baseTrademark/remove/${id}`);
};
//所有品牌列表
export const reqTrademarkList = () => {
  return server.get<any, trademarkListType[]>(
    `/product/baseTrademark/getTrademarkList`
  );
};
